package com.qyer.search.storm.util;

import java.io.Serializable;

/**
 * Created by tangzheng on 16/1/10.
 */
public class Tag implements Serializable {
  private int tid;
  private String tag_name;
  private int tag_type;
  private double coefficient;
  private int status;

  public Tag() {
  }

  public Tag(int tid, String tag_name, int tag_type, double coefficient, int status){
    this.tid = tid;
    this.tag_name = tag_name;
    this.coefficient = coefficient;
    this.status = status;
    this.tag_type = tag_type;
  }

  public int getStatus() {
    return status;
  }

  public void setStatus(int status) {
    this.status = status;
  }

  public double getCoefficient() {
    return coefficient;
  }

  public void setCoefficient(double coefficient) {
    this.coefficient = coefficient;
  }

  public int getTag_type() {
    return tag_type;
  }

  public void setTag_type(int tag_type) {
    this.tag_type = tag_type;
  }

  public String getTag_name() {
    return tag_name;
  }

  public void setTag_name(String tag_name) {
    this.tag_name = tag_name;
  }

  public int getTid() {
    return tid;
  }

  public void setTid(int tid) {
    this.tid = tid;
  }

  @Override public String toString() {
    return "Tag{" +
      "tid=" + tid +
      ", tag_name='" + tag_name + '\'' +
      ", tag_type=" + tag_type +
      ", coefficient=" + coefficient +
      ", status=" + status +
      '}';
  }

  @Override public boolean equals(Object o) {
    if (this == o)
      return true;
    if (o == null || getClass() != o.getClass())
      return false;

    Tag tag = (Tag) o;

    if (tid != tag.tid)
      return false;
    if (tag_type != tag.tag_type)
      return false;
    if (Double.compare(tag.coefficient, coefficient) != 0)
      return false;
    if (status != tag.status)
      return false;
    return tag_name.equals(tag.tag_name);

  }

  @Override public int hashCode() {
    int result;
    long temp;
    result = tid;
    result = 31 * result + tag_name.hashCode();
    result = 31 * result + tag_type;
    temp = Double.doubleToLongBits(coefficient);
    result = 31 * result + (int) (temp ^ (temp >>> 32));
    result = 31 * result + status;
    return result;
  }
}
